package com.arcadia.d2.hero_attributes;

import com.arcadia.d2.hero.Hero;

public class Armor {
	
	private int baseArmor;
	private double iArmor;

	public Armor(int baseArmor){
		this.baseArmor = baseArmor;
	}
	
	//Accessors
	public int getBaseArmor(){
		return baseArmor;
	}
	
	public double getIArmor(){
		return iArmor;
	}
	
	//Mutators
	public int calculateIArmor(Hero hero){
		
		
		return 0;
	}

	public void setBaseArmor(int baseArmor){
		this.baseArmor = baseArmor;
	}
	
	/*public void setBaseBySpecial(int id, Ability ability){
		
	}*/

	public void setIArmor(int iArmor, double iAgility){
		this.iArmor += iArmor + iAgility * 0.1;
	}

	public double getPhysicsReduction(){
		double totalArmor = this.baseArmor + this.iArmor;
		if(totalArmor>=0)	return (totalArmor * 0.06) / (1 + totalArmor * 0.06);
		else	return Math.pow( 0.94 , (-totalArmor) )-1;
	}
}
